﻿@model OnlineEducation.Data.Entities.Code
@{
    Layout = null;
}

<div class="modal-header">
    @if (Model.ID != 0)
    {
        <h4 class="modal-title">修改</h4>
    }
    else
    {
        <h4 class="modal-title">新增</h4>
    }

    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form onsubmit="return SubmitAddEdit(this)">
    <div asp-validation-summary="ModelOnly" class="text-danger"></div>
    <input asp-for="ID" type="hidden" value="@Model.ID" />
    <input asp-for="Category" type="hidden" value="Subject" />

    <div class="modal-body p-4">
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">

                    <label for="Name" class="control-label">
                        <span class="text-danger">*</span>科目代码
                        <i class="mdi mdi-help-circle mr-1 text-primary" title="科目代码，一般用4位数字，如1000。"
                           data-plugin="tippy" data-tippy-animation="perspective" data-tippy-arrow="true">

                        </i>
                    </label>
                    @if (Model.ID != 0)
                    {
                        <input asp-for="Name" readonly class="form-control" />
                    }
                    else
                    {
                        <input asp-for="Name" class="form-control" />
                        <span asp-validation-for="Name" class="text-danger"></span>
                    }
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label for="Value" class="control-label"><span class="text-danger">*</span>科目名称 <i class="mdi mdi-help-circle mr-1 text-primary" title="科目名称，如语文，数学等，添加课程时会选择科目" data-plugin="tippy" data-tippy-animation="perspective" data-tippy-arrow="true"></i></label>
                    <input asp-for="Value" class="form-control" />
                    <span asp-validation-for="Value" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label asp-for="Status" class="control-label"></label>
                    <select asp-for="Status" class="form-control" asp-items="Html.GetEnumSelectList<OnlineEducation.Enums.Status>()"></select>
                    <span asp-validation-for="Status" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label for="Remark" class="control-label">备注</label>
                    <textarea asp-for="Remark" rows="5" class="form-control"></textarea>
                </div>
            </div>
        </div>

    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-primary waves-effect waves-light">保存</button>
    </div>
</form>
<script>
    Ladda.bind('.btn-primary', { timeout: 1000 });
    $(function () {
        tippy('.mdi-help-circle');
    });

</script>
